import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import(/* webpackChunkName: "about" */ '../views/Register.vue')
  },
  {
    path: '/submitForm',
    name: 'SubmitForm',
    component: () => import('../views/SubmitForm.vue')
  },
  {
    path: '/modifyPersonalInformation',
    name: 'modifyPersonalInformation',
    component: () => import('../views/modifyPersonalInformation.vue')
  },
  {
    path: '/adminLogin',
    name: 'AdminLogin',
    component: () => import('../views/AdminLogin.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    redirect:'/chart', // 设置默认打开的子路由页面
    children:[
      {
        path: '/chart',
        name: 'Chart',
        component: () => import('../views/Chart'),
      },
      {
        path: '/accountManage',
        name: 'AccountManage',
        component: () => import('../views/AccountManage'),
      },
      {
        path: '/submitManage',
        name: 'SubmitManage',
        component: () => import('../views/SubmitManage'),
      },
      {
        path: '/submitManagePagination',
        name: 'SubmitManagePagination',
        component: () => import('../views/SubmitManagePagination')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
